import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'home',
    component: () => import('@/views/home/index.vue'),
    meta: { title: '首页' }
  },
  {
    path: '/works',
    name: 'works',
    component: () => import('@/views/works/index.vue'),
    meta: { title: '作品展示' }
  },
  {
    path: '/life',
    name: 'life',
    component: () => import('@/views/life/index.vue'),
    meta: { title: '生活分享' }
  },
  {
    path: '/skills',
    name: 'skills',
    component: () => import('@/views/skills/index.vue'),
    meta: { title: '技能展示' }
  },
  {
    path: '/works/detail',
    name: 'WorkDetail',
    component: () => import('@/views/works/detail.vue')
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
